<?php
namespace app\admin\model;

use think\Model;
use think\Request;

class User extends Model
{

    public static  function getlist(Request $request)
    {
        $genData = $request->get();
        $genData = getOutpageData($genData);
        if (count($genData)>=2||isset($genData['searchval'])||isset($genData['nickName'])) {
            $fileds = ['nickName'];
            $whereOrData = genWhereOrData($genData,$fileds);
            $model= makeWhereObject((new self()), $whereOrData);
//            var_dump($whereOrData);die;
        } else {
            $model= makeWhereObject((new self()), $genData);
        }
        $res = $model->order('id','desc')->paginate(10, false,[  'var_page' => 'page']);
        return $res;
    }


}
